home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr11
/
pdox693.zip
/
TI1105.ASC
< prev
next >
Wrap
Text File
|
1992-08-17
|
4KB
|
133 lines
PRODUCT : Paradox NUMBER : 1105
VERSION : 4.0
OS : DOS
DATE : August 17, 1992 PAGE : 1/2
TITLE : Using Immediate If to Eliminate Blank Spaces In
Reports
Intended Audience:
This Technical Information sheet is intended for someone with a
moderate level of Paradox knowledge.
Prerequisites:
A basic understanding of the Paradox Report Generator. A
familiarity with using calculated fields.
Purpose:
This Technical Information sheet illustrates how you can use the
PAL Immediate If function, IIF(), to eliminate the blank spaces
that are produced when concatenating fields together where one of
the fields is blank.
Occasionally it may be desirable to print reports wherein one of
the fields on a line of the report may be empty. A common
example is printing out the first, middle and last name fields on
a line where the middle field may be blank. Suppose the fields
[F], [M] and [L] represent the fields First Name, Middle Name,
and Last Name respectively. In such a scenario, using
fieldsqueeze or a calculated field with the expression [F] + " "
+ [M] + " " + [L] will result in extra spaces being printed if
the "M" field is blank. The Paradox 4.0 Immediate If PAL
function, IIF(), can be used to eliminate the blank spaces that
are produced when concatenating fields together where one of the
fields is blank.
The Immediate If function returns one of two values depending on
the value of a logical condition. The syntax of the Immediate If
function is as follows:
IIF(Condition, ValueIfTrue, ValueIfFalse)
The example below removes the extra space encountered when
the "Middle" field is blank. Use the following expression in a
calculated field:
IIF(ISBLANK([M]), [F] + " " + [L], [F] + " " + [M] + " " + [L])
The expression ISBLANK([M]) evaluates whether the "M" field is
blank. If the "M" field is blank, Paradox concatenates the "F"
and "L" fields separating them by one space. If the "M" field is
PRODUCT : Paradox NUMBER : 1105
VERSION : 4.0
OS : DOS
DATE : August 17, 1992 PAGE : 2/2
TITLE : Using Immediate If to Eliminate Blank Spaces In
Reports
not blank, Paradox concatenates the "F", "M" and "L" fields
separating each of the fields by one space.
The example below compares the results of using the IIF() vs.
using Fieldsqueeze. Notice that Fieldsqueeze incorporates two
extra blank spaces when the "M" field is blank, whereas IIF()
properly concatenates the fields.
Field Values Report Field Report Field
Using IIF() Using
F M L Fieldsqueeze
----------------- ------------- --------------
John R. Smith John R. Smith John R. Smith
Mary Jones Mary Jones Mary Jones
The IIF() expression can be placed in calculated fields in both
reports and forms, provided that the expression is no longer than
175 characters in length. There are many possible ways to use
IIF(). When implementing the Immediate If function, it is a good
idea to test for all possible values to achieve the desired
results.
For additional information about PAL, refer to the PAL Reference
Guide.
DISCLAIMER: You have the right to use this technical information
subject to the terms of the No-Nonsense License Statement that
you received with the Borland product to which this information
pertains.